package com.kuizii.base.config;

import com.kuizii.base.util.log.ConsoleLogWriter;
import com.kuizii.base.util.log.ILogWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(AuditLogConfigProperties.class)
public class AuditLogConfig {

    @Autowired
    AuditLogConfigProperties properties;


    @ConditionalOnMissingBean(ILogWriter.class)
    @Bean
    ILogWriter writer() {
        ConsoleLogWriter logWriter = new ConsoleLogWriter();
        return logWriter;
    }
}
